package 访问者设计模式;

public class Hospital {
    public static void main(String[] args) {
        Doctor doctor = new Doctor();
        doctor.addMedicine(new Amoxicillin());
        doctor.addMedicine(new Painkiller());

        Pharmacist pharmacist = new Pharmacist();
        pharmacist.setName("张三");
        doctor.accept(pharmacist);


        Patients patients = new Patients();
        patients.setName("王五");
        doctor.accept(patients);

    }
}
